﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MySQLApplication
{
    class MainHandler
    {
        MySQLHandler mySQLHandler;

        CommandHandler commandHandler;
        List<Command> commandList; // Command is an abstract class.  Each command will do something different in the "execute" function.
           
        public MainHandler()
        {
            mySQLHandler = new MySQLHandler(); // Not including try statements here because they're already in the constructor of MySQLHandler
            commandHandler = new CommandHandler();
            commandList = new List<Command>();
            commandList.Add(new cmd_Export());
            commandList.Add(new cmd_ChangeDatabase());

            while (true) // Infinite loop.  Ends whenever either the program is closed or whenever they put in a the "quit" command.
                // a condition here is unnecessary.
            {
                commandHandler.getInput();
                commandHandler.processInput(commandList);
            }
        }
    }
}
